package top.wilsonlv.jaguar.dept.data.permission;

import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lvws
 * @since 2022/8/9
 */
@Configuration
public class DeptDataPermissionAutoConfiguration {

    @Bean
    public DataPermissionInterceptor dataPermissionInterceptor(DeptDataPermissionHandler deptDataPermissionHandler) {
        DataPermissionInterceptor dataPermissionInterceptor = new DataPermissionInterceptor();
        dataPermissionInterceptor.setDataPermissionHandler(deptDataPermissionHandler);
        return dataPermissionInterceptor;
    }

}
